Simulation of graphical models is an important tool in the design and analysis of physical systems. Simulation enables the studying of system behavior, the automatic performing of optimizations, and the evaluation of system analysis algorithms, among other uses. Various classes of graphical models describe computations that can be performed on application specific computational hardware, such as a computer, microcontroller, FPGA, and custom hardware. Classes of such graphical models include time-based block diagrams such as those found within Simulink® from the MathWorks, Inc. of Natick Mass., state-based and flow diagrams such as those found within Stateflow® from the MathWorks, Inc. and data-flow diagrams. A common characteristic among these various forms of graphical models is that they define semantics on how to execute the model.
During the initialization phase of a graphical model that occurs prior to the execution/simulation of a graphical model, each model component is analyzed. Many model components correspond to underlying code that is evaluated in order to initialize the model. The underlying code expression is evaluated in light of the modeling domain to which it corresponds. For example, for a statechart environment, the expression being evaluated must contain numeric constants, statechart constants, statechart parameters, and references to the size of other statechart data. Following the evaluation of all of the underlying expressions corresponding to the model components, the graphical model may be simulated or executed.
Unfortunately, conventional mechanisms for evaluating expressions do not lend themselves to heterogeneous computing environments where hybrid expressions include references to more than one type of modeling domain. For example, in a statechart environment, an expression conventionally cannot contain an inherited size from a block diagram modeling domain. As a result, the ability to integrate model components from different types of modeling domains is limited.